package cn.iocoder.yudao.module.member.dal.mysql.jobmajor;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.controller.admin.jobmajor.vo.JobMajorPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.jobmajor.JobMajorDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 岗位专业中间 Mapper
 *
 * @author Alan
 */
@Mapper
public interface JobMajorMapper extends BaseMapperX<JobMajorDO> {

    default PageResult<JobMajorDO> selectPage(JobMajorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JobMajorDO>()
                .eqIfPresent(JobMajorDO::getMajorId, reqVO.getMajorId())
                .likeIfPresent(JobMajorDO::getMajorName, reqVO.getMajorName())
                .eqIfPresent(JobMajorDO::getJobId, reqVO.getJobId())
                .betweenIfPresent(JobMajorDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(JobMajorDO::getId));
    }

}